package com.mirabelle.juice.service;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mirabelle.juice.dao.CollectionDao;
import com.mirabelle.juice.model.Author;
import com.mirabelle.juice.model.Collection;

@Service("CollectionService")
public class CollectionServiceImpl implements CollectionService, Serializable {
	private static final long serialVersionUID = 1L;
	
	@Autowired
	CollectionDao					collectionDao;
	
	/*
	public List<Collection> findCollectionByAuthor(Author author);
	public void addCollection(Collection collection);
	public void saveCollection(Collection collection);
	public void removeCollection(Collection collection);
	 */
	
	@Override
	public List<Collection> findAll() {
		return collectionDao.getAll();
	}

	@Override
	public List<Collection> findCollectionByAuthor(Author author) {
		return collectionDao.findByAuthor(author);
	}
	
	@Override
	public void addCollection(Collection collection) {
		collectionDao.add(collection);
	}
	
	@Override
	public void saveCollection(Collection collection) {
		collectionDao.save(collection);
	}
	
	@Override
	public void removeCollection(Collection collection) {
		collectionDao.remove(collection);
	}
}
